<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>物流信息</title>
    <link href="../../lib/layui-v2.6.3/css/layui.css" media="all" rel="stylesheet">
    <script src="../../lib/layui-v2.6.3/layui.js"></script>
    <script src="../../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
    <script src="../../js/template-web.js"></script>
    <script src="../../frontstatic/js/notify.js"></script>
    <script src="../../frontstatic/js/notify_stand.js"></script>
    <style type="text/css">
        body{
            background-color: #FFFFFF;
        }
    </style>
</head>
<body>
    <div style="margin-left: 280px;margin-top: 80px" id="trankui"></div>
</body>
<script id="trackTemplate" type="text/template">
    <div style="width: 600px;height: 80px;margin-top: -40px;color: #787575">
        <img src="{{datebate.logo}}">
        <span style="margin-left: 20px">联系电话:{{datebate.expPhone}}</span>
        <span style="margin-left: 20px">配送分公司:{{datebate.courier}}</span><br/>
        <div style="margin-top: 20px">
            <span>派件联系电话:{{datebate.courierPhone}}</span>
            <span style="margin-left: 20px">物流单号:{{datebate.number}}</span>
            <span style="margin-left: 20px">运输时长:{{datebate.takeTime}}</span><br/>
        </div>
        <div style="margin-top: 20px">
            <span  >更新时间:{{datebate.updateTime}}</span>
        </div>
    </div>
        <ul class="layui-timeline" style="margin-top: 100px">
            {{each datebate.list item}}
                <li class="layui-timeline-item">
                    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                    <div class="layui-timeline-content layui-text">
                        <h3 class="layui-timeline-title">{{item.time}}</h3>
                        <p>{{item.status}}</p>
                    </div>
                 </li>
            {{/each}}
        </ul>
</script>
<script>
    var notify;
    layui.use(['notify'],function(){
        notify=layui.notify;
    })
    function getQueryString(name) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return unescape(r[2]);
        }
        return null;
    }
    var id = getQueryString("id");
    $.get("/order/getlogistics",{"id":id},function(ex){
        console.log(ex.data.result)
       if (ex.code==0){
           date = {datebate: ex.data.result}
           mera = template("trackTemplate", date);
           $("#trankui").append(mera);
           notify.success(ex.data.msg)
       }else {
           notify.error(e.msg)
       }
    })
</script>
</html>